package march.test_3_25;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[] dp = new int[100000];
        dp[0] = 1;
        dp[1] = 2;
        for (int i = 2; i < 100000; i++) {
            dp[i] = dp[i -1] + dp[i - 2];
            dp[i] %= 1000000;
        }
        while (scanner.hasNextInt()) {
            int n = scanner.nextInt();
            if(n >= 1 && n <= 100000) {
                System.out.println(dp[n-1]);
            }
        }
    }
}
